//
//  WKWebView+DGGBridge.m
//  DGGMiniProgramSDK
//
//  Created by 胡中楷 on 2020/3/28.
//

#import "WKWebView+DGGBridge.h"
#include <objc/runtime.h>

static NSString * const kBridgeHandleClassKey = @"bridgeHandleClassKey";

@implementation WKWebView (DGGBridge)

- (void)setBridgePlugin:(DGGBridgePluginBase *)bridgePlugin{
    objc_setAssociatedObject(self, &kBridgeHandleClassKey, bridgePlugin, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (DGGBridgePluginBase *)bridgePlugin{
    return objc_getAssociatedObject(self, &kBridgeHandleClassKey);
}

- (void)dealloc{
#if DEBUG
    NSLog(@"♦️释放♦️%@",NSStringFromClass([self class]));
#endif
}

@end


